<%@ page import="auctionhaus.Customer" %>



<div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'emailAddress', 'error')} ">
	<label for="emailAddress">
		<g:message code="customer.emailAddress.label" default="Email Address" />
		
	</label>
	<g:field type="email" name="emailAddress" value="${customerInstance?.emailAddress}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'password', 'error')} ">
	<label for="password">
		<g:message code="customer.password.label" default="Password" />
		
	</label>
	<g:textField name="password" maxlength="8" value="${customerInstance?.password}"/>
</div>

<g:if test="${session.customer && session.customer.isAdmin && session.customer.id != customerInstance.id}">
    <div class="fieldcontain" ${hasErrors(bean: customerInstance, field: 'isAdmin', 'error')} ">
        <label for="isAdmin">
            <g:message code="customer.isAdmin.label" default="Administrator" />

        </label>
        <g:checkBox name="isAdmin" value="${customerInstance?.isAdmin}"/>
    </div>
</g:if>

<div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'bids', 'error')} ">
	<label for="bids">
		<g:message code="customer.bids.label" default="Bids" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${customerInstance?.bids?}" var="b">
    <li>${b?.listing.name + ': '}<g:formatNumber number="${b?.amount}" type="currency" currencyCode="USD" /></li>
</g:each>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: customerInstance, field: 'listings', 'error')} ">
	<label for="listings">
		<g:message code="customer.listings.label" default="Listings" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${customerInstance?.listings?}" var="l">
    <li><g:link controller="listing" action="show" id="${l.id}">${l?.name}</g:link></li>
</g:each>
</ul>

</div>

